<?PHP
    ob_start();
    session_start();

    require_once("dbconnect.php");
    require_once("classes/admin_users.php");

    if(isset($_SESSION['gbl_user_id'])) {
        header("location:my_admin.php");
    }

    if($_POST['submit'] != "") {
        $userObj=new admin_users("");
        $mesg=$userObj->validateUser($_POST['username'],$_POST['password']);
    }
?>
<script language="Javascript">
    <!--
    // Validation for non empty fields and correct input values
    function chklogin()
    {
        if(document.frmLogin.username.value=="")
        {
            alert("Please enter your username!");
            document.frmLogin.username.focus();
            return false;
        }

        if(document.frmLogin.password.value=="")
        {
            alert("Please enter your password!");
            document.frmLogin.password.focus();
            return false;
        }
        if(document.frmLogin.password.value.length < 6)
        {
            alert("Password length should be minimum 6 characters!");
            document.frmLogin.password.focus();
            return false;
        }

        return true;
    }
    //-->
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="stylesheet/eparinay.css" type="text/css" rel="stylesheet" />
        <style type="text/css" title="currentStyle">
            @import "css/demo_page.css";
            @import "css/demo_table.css";
        </style>
        <script type="text/javascript" src="../javascript/buddhist.js"></script>
        <script type="text/javascript" language="javascript" src="javascript/jquery.js"></script>
        <script type="text/javascript" language="javascript" src="javascript/jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                $('#example').dataTable();
            } );
        </script>
        <title>Welcome to eParinay.com - No1. Buddhist Matrimonial</title>
    </head>

    <body>
        <div id="main_container_full" style="background-color:#fff;">

            <div id="admin_center_body" style="padding:1% 40%;float:left">

                <div id="header_container_full" style="clear:both;height:100px;">

                    <!-- make_homepage ends -->
                    <div id="logo_container_full">
                        <div id="logo"><a href="my_admin.php"><img src="images/images/logo.jpg" width="180" height="72" border="0" /></a></div>

                        <div align="center">Welcome Administrator</div>

                    </div><!-- logo_container ends -->

                </div><!-- header_container ends -->


                <form name="form1" method="POST" action="login.php">
                    <div id="admin_login_row"><? if($mesg) { ?></div>
                    <div id="admin_login_row"><?=$mesg?></div>
                    <div id="admin_login_row"><? } ?></div>
                    <div id="admin_login_row">
                        <div id="admin_login_text">Admin</div>
                        <div id="admin_login_input"><input name="username" type="text" id="username"  /></div>
                    </div>
                    <div id="admin_login_row">
                        <div id="admin_login_text">Password</div>
                        <div id="admin_login_input"><input name="password" type="password" id="password" /></div>
                    </div>
                    <div id="admin_login_row">
                        <div id="admin_login_text">&nbsp;</div>
                        <div id="admin_login_input"><div id="button_border">
                                <input name="submit" type="submit" class="button" id="submit" style="" value="Login"  onClick="return chklogin()" />
                            </div></div>
                    </div>
                </form>


            </div>

            <div id="bottom_container_full" style="margin-left:auto; margin-right:auto; width:auto; clear:both;">
                <div id="bottom_links" ><br />
                    Copyright &copy; 2006 <a href="#" class="bot_links">Sanchi Infotech</a>. All Rights Reserved.	</div>
            </div><!-- bottom_container ends -->
        </div><!-- main_container ends -->
    </body>
</html>

